home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Reference Guide / C-C++ Interactive Reference Guide.iso / c_ref / csource5 / 349_01 / sss.arc / EX_0206.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1991-04-09  |  627 b   |  33 lines

  1. Program EX_0206;
  2. {Listing 2P - see documentation in TUTOR.SSS}
  3.  
  4. uses SSS;
  5. { For Pascal other than Turbo/Quick erase above line }
  6.  
  7. { For MS Pascal $include:'SSSP1.H' }
  8.  
  9. var
  10.   pt : real;
  11.  
  12. { For MS Pascal $include:'SSSP2.H' }
  13.  
  14. function rnx(m, s: real): real;
  15. var x : real;
  16. begin
  17.   repeat
  18.     x := RN(m, s);
  19.   until x > 0.0;
  20.   rnx := x;
  21. end;
  22.  
  23. begin
  24.   pt := rnx(7, 4);
  25.   repeat
  26.     write('Start of call is at ',pt:5:2);
  27.     if RA < 0.25 then pt := pt + ER(2,2) else
  28.                       pt := pt + TR(1,3,4);
  29.     writeln(', ends at ',pt:5:2);
  30.     pt := pt + rnx(7,4);
  31.   until pt >= 120;
  32. end.
  33.